<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="">
	<meta name="author" content="">

	<title>Dashboard Template for Bootstrap</title>
	<!-- Bootstrap core CSS -->
	<link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet">
	<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
	<!-- Custom styles for this template -->
	<link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
	<style type="text/css">
		/* Chart.js */

		@-webkit-keyframes chartjs-render-animation {
			from {
				opacity: 0.99
			}
			to {
				opacity: 1
			}
		}

		@keyframes chartjs-render-animation {
			from {
				opacity: 0.99
			}
			to {
				opacity: 1
			}
		}

		.chartjs-render-monitor {
			-webkit-animation: chartjs-render-animation 0.001s;
			animation: chartjs-render-animation 0.001s;
		}
	</style>
</head>

<body>

<!--引入抽取的topbar-->
<!--模板名：会使用thymeleaf的前后缀配置规则进行解析-->
<div th:replace="commons/bar::topbar"></div>

<div class="container-fluid">
	<div class="row">
		<!--引入侧边栏-->
		<div th:replace="commons/bar::#sidebar(activeUri='/activity/activity')"></div>

		<n role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
			<h3>活动列表：</h3>
			<form th:action="@{/activity/getactivity}" method="post">
				<input type="text"  name="title" placeholder="标题/创建者" >
				时间：<input type="text"  name="beginTime" placeholder="时间" > -
				<input type="text"  name="endTime" placeholder="时间" >
				<input type="submit" class="btn btn-sm btn-primary" value="搜索">

				<a class="btn btn-sm btn-success" href="emp" th:href="@{/activity/addactivity}">新增</a>
			</form>
			</select>
			<div class="table-responsive">

				<table class="table table-striped table-sm"  style="text-align:center" >
					<thead>
					<tr>
						<th>序 号</th>
						<th>标 题</th>
						<th>活动创建者</th>
						<th>类 型</th>
						<th>开始时间</th>
						<th>结束时间</th>
						<th>链 接</th>
						<th>状态
							<select id="publishStateid" name="publishState">
								<option>选择</option>
								<option value="-1">所有状态</option>
								<option value="1">未发布</option>
								<option value="2">已发布</option>
								<option value="3">撤销发布</option>
							</select><br/>
						</th>
						<th>推荐
							<select id="homeTopid" name="homeTop">
								<option>选择</option>
								<option value="-1">所有状态</option>
								<option value="1">未推荐</option>
								<option value="2">已推荐</option>
							</select><br/>
						</th>

						<th>点赞量</th>
						<th>访问量</th>
						<th>收藏量</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
					<tr th:each="list,activity:${activity}">
						<td th:text="${activity.count}"></td>
						<td th:text="${list.activityConstom.title}"></td>
						<td th:text="${list.activityConstom.username}"></td>
						<td th:text="${list.activityConstom.name}"></td>
						<td th:text="${list.activityConstom.beginTime}"></td>
						<td th:text="${list.activityConstom.endTime}"></td>
						<td th:text="${list.activityConstom.link}"></td>
						<td th:text="${list.activityConstom.publishStateDesc}"></td>
						<td th:text="${list.activityConstom.topHomeDesc}"></td>
						<td th:text="${list.activityConstom.upCount}"></td>
						<td th:text="${list.activityConstom.viewCount}"></td>
						<td th:text="${list.activityConstom.favCount}"></td>
						<td>
							<a class="btn btn-sm btn-primary"  th:href="@{/activity/publishactivity/}+${list.activityConstom.id}">发布</a>
							<a class="btn btn-sm btn-primary"  th:href="@{/activity/notpublishactivity/}+${list.activityConstom.id}">取消发布</a>
							<a class="btn btn-sm btn-primary"  th:href="@{/activity/updateactivity/}+${list.activityConstom.id}">编辑</a>
							<a class="btn btn-sm btn-primary"  th:href="@{/activity/topactivity/}+${list.activityConstom.id}">推荐</a>
							<a class="btn btn-sm btn-primary"  th:href="@{/activity/nottopactivity/}+${list.activityConstom.id}">取消推荐</a><br/>
							<a class="btn btn-sm btn-primary"  th:href="@{/activity/deleteactivity/}+${list.activityConstom.id}">删除</a>
						</td>
					</tr>
					</tbody>

					<script type="text/javascript">
                        var ctx = /*[[@{/}]]*/ '';
                        $("#homeTopid").change(function () {
                            var homeTopid = $(this).val()
                            location.href = ctx+"getactivity?homeTop="+homeTopid;
                        })

                        var ctx = /*[[@{/}]]*/ '';
                        $("#publishStateid").change(function () {
                            var publishStateid = $(this).val()
                            location.href = ctx+"getactivity?publishState="+publishStateid;
                        })

					</script>
				</table>
			</div>
			</main>
			<form id="deleteEmpForm"  method="post">
				<input type="hidden" name="_method" value="delete"/>
			</form>
	</div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->

</body>
</html>